Skip to content

Fixes #235 : concurrency bug in FSTStreamDecoder/FSTStreamEncoder#254

Open
andrewl102 wants to merge 1 commit intoRuedigerMoeller:masterfrom
andrewl102:master
Open

Fixes #235 : concurrency bug in FSTStreamDecoder/FSTStreamEncoder#254
andrewl102 wants to merge 1 commit intoRuedigerMoeller:masterfrom
andrewl102:master

Conversation

@andrewl102
Copy link
Copy Markdown

The current implementation of the cache within these classes is not thread safe, as seen by #235 and the test case I have attached to that issue.

This might potentially have some negative performance implications but overall given the severity of the bug, I believe correctness might be more important.
Proper synchronization or protection against these fields is likely possible but beyond my current understand of the codebase, as the code involved for this is quite complex.

@RuedigerMoeller
Copy link
Copy Markdown
Owner

well, this has a major performance draw back, will try using Atomic locks or so

@perlun
Copy link
Copy Markdown

perlun commented Jan 24, 2019

@RuedigerMoeller Any idea of when you anticipate to have time to look into this further?

@RuedigerMoeller
Copy link
Copy Markdown
Owner

RuedigerMoeller commented May 17, 2020

will have to do performance tests before merging. fst is not thread save by intent, its just too costly in high performance use cases. Even introducing some allocations on hotspot has measurable impact.

@winrid
Copy link
Copy Markdown

winrid commented May 8, 2022

@RuedigerMoeller is this still an issue? It looks like in the docs FSTConfiguration is meant to be thread safe. Is that not the case?

@perlun
Copy link
Copy Markdown

perlun commented May 13, 2022

@winrid Don't know the details about this particular bug, but see also #270 and #274 for some concurrency-related issues. We ended up moving away from FST since we couldn't get it to be stable enough for our use case. 😢

@winrid
Copy link
Copy Markdown

winrid commented May 13, 2022

@perlun Thanks. Yeah it looks like a really cool project, but it's a tough problem :)

We ended up just hand rolling the serialization stuff for now because I couldn't find anything that satisfied all our requirements. Also it's a game and we are really counting bytes...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants